package com.sctvcloud.zhaohua_sd.ui.activities;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;

import com.sctvcloud.zhaohua_sd.R;
import com.sctvcloud.zhaohua_sd.ui.utils.TitleUtils;

import java.util.Timer;
import java.util.TimerTask;

/**
 * 广告页（未使用？）
 */
public class AdBlankActivity extends AppCompatActivity {

    private Timer timer;
    private TimerTask timerTask;
    private int count = 3;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_ad_blank);
        new TitleUtils(this);
        findViewById(R.id.iv_blank).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        timerTask = new TimerTask() {
            @Override
            public void run() {
                if (count > 0) {
                    count--;
                } else {
                    timer.cancel();
                    timerTask.cancel();
                    finish();
                }
            }
        };
        timer = new Timer();
        timer.schedule(timerTask, 0, 1000);
    }
}
